var vueApp = new Vue({
  el: '#app',
  data: function () {
    return {
    	loading: false,
    	count: 10,
        currentPageNbr: config.currentPageNbr,
        pageSizes: config.pageSizes,
        pageSize: 10,
        totalRecords: 0,       
        datalist: [],

      };
  },
  computed: {
	  noMore : function () {
		 //this.datalist.length，此长度是每次请求相机数据叠加的，this.scrollbarTotal是后台返回的数据总数
		  return this.datalist.length > this.totalRecords
	      },
	  disabled : function () {
		  //scrollDisabled == false,可以滚动
	      return this.loading || this.noMore
	     }
    },
  mounted: function () {
   

  },
  methods: {
   
	      load : function () {	    	  
	         this.loading = true;
	         setTimeout(() => {
	             console.log("loading");	            
	             //请求相机列表
	             this.onSearch();
	             this.currentPageNbr += 1;
	             this.loading = false;
	           }, 1000)
	        },
	        
	
	       onSearch:function(){	    	     
	    	      var that = this;   	    	      
	    	      var jsonStr ={};	 
	    	      jsonStr.source="mp";
	    	      var postdata = {
	    	            "jsonStr": JSON.stringify(jsonStr),           
	    	            "currentPageNbr" : this.currentPageNbr,
	    	            "pageSize" : this.pageSize
	    	      };

	    	      tools.ajaxRequestAsyncEx("pub/attach/filelist",postdata, function(data){
	    	           if (data.respCode == "0") {
	    	        	  console.log(data.list);
	    	        	  that.totalRecords = data.page.totalRecords; 
	    	              let list = data.list;	   	            
	    	              for(let i=0; i<list.length; i++){
	    	            	  that.datalist.push(list[i]);
	    	                }
	    	           } 
	    	          
	    	      });


	    	 },
	    	 preImg:function(row){
	    	    	if(row.url!="")
	    	    	{
	    	    		var arr= [] ;
	    	    		arr.push(row.url);
	    	    		return arr;
	    	    	}    	
	    	        return arr;
	    	    },
	    	    
	    	    
	    	    
  },
  watch:{
     
  }
  
})